#include <GL/gl.h>
#include <GL/glu.h>
#include "initgl.h"

int main()
{
  int running = GL_TRUE;

  init(800, 600, GLFW_FULLSCREEN);

  while( running )
    {
      glClear(GL_COLOR_BUFFER_BIT);

      // draw
      glBegin(GL_QUADS);
      glColor3ub(0,0,255);
      glVertex2d(-0.75,-0.75);
      glVertex2d(-0.75,0.75);
      glColor3ub(255,0,0);
      glVertex2d(0.75,0.75);
      glVertex2d(0.75,-0.75);
      glEnd();

      // Swap front and back rendering buffers
      glfwSwapBuffers();

      // Check if ESC key was pressed or window was closed
      running = !glfwGetKey( GLFW_KEY_ESC ) && glfwGetWindowParam( GLFW_OPENED );
    }

  quit();

  return 0;
}
